package com.alexander.scanregisterarouter.plugin;

import com.alexander.scanregisterarouter.transform.ScanRegisterARouterTransform;
import com.android.build.gradle.AppExtension;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

/**
 * author : cjw
 * date : 2022/2/9
 * description :
 */
public class ScanRegisterARouterPlugin implements Plugin<Project> {
    @Override
    public void apply(Project project) {
        System.out.println("---this is custom gradle plugin---");
        AppExtension android = project.getExtensions().getByType(AppExtension.class);
        ScanRegisterARouterTransform transform = new ScanRegisterARouterTransform();
        android.registerTransform(transform);
        System.out.println("---register 'ScanRegisterARouterTransform' success---");
    }
}
